-[UITableViewRowData isEqualToString:]: unrecognized selector sent to instance 0x391dce0

Posted by tak on Stack Overflow See other posts from Stack Overflow or by tak
Published on 2010-04-28T21:07:09Z Indexed on 2010/04/28 21:17 UTC
Read the original article Hit count: 248

Filed under:

I have a datatable which shows the list of contacts. when I start the application all the data is loaded correctly.But after selecting a contact, I am sometimes getting this exception :-

Program received signal: “EXC_BAD_ACCESS”. and sometimes

-[UITableViewRowData isEqualToString:]: unrecognized selector sent to instance 0x391dce0

most probably for this code:-

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

}
ExpenseTrackerAppDelegate *appDelegate = (ExpenseTrackerAppDelegate *)[[UIApplication sharedApplication] delegate];

Person *person = (Person *)[appDelegate.expensivePersonsList objectAtIndex:indexPath.row]; NSString *name = (NSString *)[NSMutableString stringWithFormat:@"%@ %@" ,person.lastName , person.firstName]; cell.textLabel.text = name; //cell.detailTextLabel.text = person.lastName; // Configure the cell.

return cell;

}

If I replace these lines of code

NSString *name = (NSString *)[NSMutableString stringWithFormat:@"%@ %@" ,person.lastName , person.firstName]; cell.textLabel.text = name;

with this code cell.textLabel.text = person.lastName;

then everything works fine?

I dont know what exactly happens?

© Stack Overflow or respective owner

Related posts about iphone